package tw.cuttle.process.spring;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import tw.cuttle.CuttleContext;
import tw.cuttle.process.MethodInvokeSupport;

public class SpringBeanSupport extends MethodInvokeSupport{
    public Object getBean(String beanName){
	WebApplicationContext webApplicationContext=WebApplicationContextUtils.getWebApplicationContext(CuttleContext.getActionContext().getActionHelper().getContext());

		Object bean=webApplicationContext.getBean(beanName);
		return bean;

    }
}
